home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14638 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: yama.mcc.ac.uk!dmu!usenet
  2. From: Christopher Pilsworth <hcm94cp@dmu.ac.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: File Indexing
  5. Date: Mon, 01 Apr 1996 13:40:10 -0800
  6. Organization: DeMontfort University
  7. Message-ID: <31604D3A.16D6@dmu.ac.uk>
  8. NNTP-Posting-Host: mkcsug08.mk.dmu.ac.uk
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win16; I)
  13. CC: jsnook, gperkins
  14.  
  15. Hi there,
  16.  
  17. I am currently having a problem with how to implement a lightwieght 
  18. database application.  I have to write an application that handles 
  19. bookings for a squash court.  There are three main objects:
  20.  
  21. Member
  22. Booking
  23. Court
  24.  
  25. I have also designed a template class called "CFile" which handles all 
  26. basic record I/O. This is fine for the member table as it does not need 
  27. to be indexed ( I have a simple iterator/cursor for picking out 
  28. particular records). The bookings file however needs to be indexed on:
  29.  
  30. date + time + court number 
  31.  
  32. I would like a good way of checking that a court can not be double 
  33. booked.  A way around this I thought would be to keep the booking index 
  34. in memory as a Set (Am I right in thinking you can prevent duplicates 
  35. from being added?).  I have looked at the STL implementation, but just 
  36. looking at STL code generally gives me a headache. Is it possible 
  37. though, to make this container's contents persistant?  
  38.  
  39. I do have database libraries but I have to code this one from the ground 
  40. up.
  41.  
  42. Any help would be appreciated, either on using STL sets or just 
  43. generally on writing simple lightweight database applications in C++.
  44.  
  45. Thanks in advance
  46.  
  47.  
  48. Chris Pilsworth
  49.  
  50. DeMontfort University 
  51. Milton Keynes (UK)
  52.  
  53. PS. Please could you CC to hcm94cp@dmu.ac.uk
  54.